package com.base.db.mysql

import com.base.model.api.*
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
import org.springframework.stereotype.Repository

@Mapper
@Repository
interface MySQLMapper_Service {
    @Select("""
        SELECT
            u.id id
        FROM
            t_user_service u
        WHERE
            u.loginname=#{username} and u.password=#{password}
    """)
    fun service_getUserByAccount(username: String, password: String): List<Map<String, Any?>>?

    @Select("""
        SELECT
            u.name name,
            u.avatar avatar,
            u.yim_user yim_user,
            u.yim_token yim_token
        FROM
            t_user_service u
        WHERE
            u.id=#{uid}
    """)
    fun service_getUserInfoByUID(uid: String): List<UserModel_Service>?
}
